<%@page contentType="text/html; charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>美瀛商旅网</title>
<link href="${ctxPath}/resource/front/css/international_ticket.css"
	rel="stylesheet" type="text/css" />
	<script src="${ctxPath}/resource/front/js/airLines.js" type="text/javascript"></script>
		<link href="${ctxPath}/css/style/Tooltip.css" type=text/css rel=stylesheet />
		<SCRIPT src="${ctxPath}/css/style/superValidator.js" type=text/javascript></SCRIPT>
		<SCRIPT src="${ctxPath}/resource/common/js/idCheck.js" type=text/javascript></SCRIPT>
		<SCRIPT src="${ctxPath}/resource/common/js/dateCheck.js" type=text/javascript></SCRIPT>
		<SCRIPT src="${ctxPath}/resource/common/js/nameCheck.js" type=text/javascript></SCRIPT>
	<script type="text/javascript">
	$(function(){
		
		//setEmptyCheck("contact:passengName:passengName1");	
		setEmptyCheck("contact");	
	/* 	setIntegeCheck("memberCard");
		setMailCheck("email");
		setChineseCheck("fullname");
		setIntegeCheck("sex");*/
	//setEmptyCheck("cardNo:passengerBirthday0"); 
	//	setMailCheck("contactEmail");
		setMobileCheck("contactMob");
		
		
	var carrierName='';
	var carrier='${param['carrier']}';
	for(var i=0;i<airLines
	.length;i++){
		if(carrier==airLines[i].code){
			carrierName=airLines[i].name;
			$("#flightName").text(carrierName);
			$("#carrierName").val(carrierName);
			break;
		}
	}});
	function changeExpress(obj,type){
		var xcdPrice=obj.value;
		$("#needXcd").val(xcdPrice);
		$("#showXcd").text("¥"+xcdPrice);
		$("#expType").val(type);
		setPrice();
	}
	function show_take_table(){
		if($("#needXC").attr("checked")==true||$("#needFP").attr("checked")==true){
			var xcdPrice=$('input:radio[name="express"]:checked').val(); 
			//var xcdPrice=$("#xcdPrice").val();
			$("#needXcd").val(xcdPrice);
			$("#showXcd").text("¥"+xcdPrice);
			
			$("#contactTel").attr("check","2");
			$("#contactCode").attr("check","2");
			$("#address").attr("check","2");
			$("#sjr").attr("check","2");
			
			
			$('input[tip]').tooltip();
			
			setEmptyCheck("address:sjr");
			setMobileCheck("contactTel");
			setZipcodeCheck("contactCode");
			
			
			document.all.take_table.style.display='block';
		}else{
			$("#needXcd").val(0);
			$("#showXcd").text("¥0");
			$("#contactTel").attr("check","");
			$("#contactCode").attr("check","");
			$("#address").attr("check","");
			$("#sjr").attr("check","");
			document.all.take_table.style.display='none';
		}
		setPrice();
	}
		function showSex(obj,index){
			var cardObj=$("#cardNo"+index);
			var socialNo=$("#cardNo"+index).val();
			if(obj.value=='NI'){
				$("#num"+index).hide();
				//$("#cardNo"+index).attr("check","3");
				$("#passengerBirthday"+index).attr("check","");
			}else if(obj.value=='PP'){
				 $("#num"+index).show();
				$("#passengerBirthday"+index).attr("check","3");
				//$("#cardNo"+index).attr("check","2");
				setCheckNumber("cardNo"+index); 
			}else if(obj.value=='ID'){
				 $("#num"+index).show();
				$("#passengerBirthday"+index).attr("check","3");
				//$("#cardNo"+index).attr("check","2");
				setEmptyCheck("cardNo"+index);  
			};
			isCard(socialNo,cardObj,index);
			// updateTip();
		}
		
		//显示价格
		function setPrice(){
			
			var initBx=$("#initBx").val();
			var bxDiscount=$("#bxDiscount").val();
			
			var child=$("#child").val();
			var childBx=$("#childBx").val();
			var adult=$("#adult").val();
			var adultBx=$("#adultBx").val();
			var adultWithOutBx=$("#adultWithOutBx").val();

			var childTotal=$("#childTotal").val();
			var adultTotal=$("#adultTotal").val();
			var adultWithOutBxTotal=$("#adultWithOutBx").val();
			
			var viewPrice=$("#ADPprice").val();
			var CHDprice=$("#CHDprice").val();
			
			
			/* childTotal=parseInt(CHDprice)*child+parseInt(childBx)*initBx-parseInt(childBx)*bxDiscount;
			
			adultTotal=parseInt(viewPrice)*adult+parseInt(adultBx)*initBx-parseInt(adultBx)*bxDiscount; */
			childTotal=parseInt(CHDprice)*child+parseInt(childBx)*initBx;
			if(childBx>0){
				/* childTotal=childTotal-parseInt(bxDiscount)*parseInt(child); */
			}
			adultTotal=parseInt(viewPrice)*adult+parseInt(adultBx)*initBx;
			if(adultBx>0){
				/* adultTotal=adultTotal-parseInt(bxDiscount)*parseInt(adult); */
			}
			adultWithOutBxTotal=parseInt(viewPrice)*adultWithOutBx;
			
			var xcdPrice=$("#needXcd").val();
			var allPriceStr=parseInt(childTotal)+parseInt(adultTotal)+parseInt(adultWithOutBxTotal)+parseInt(xcdPrice);
			

			$("#insuranceStatistics").val((parseInt(childBx)+parseInt(adultBx))*initBx);
			
			
			if(adult>0){
				$("#adpImage").show();
			}else{
				$("#adpImage").hide();
			}
			if(adultWithOutBx>0){
				$("#adImage").show();
			}else{
				$("#adImage").hide();
			}
			if(child>0){
				$("#chdImage").show();
			}else{
				$("#chdImage").hide();
			}
			
			
			//套餐价格显示
			$("#ADPcount").text(adult);
			$("#ADPbxFee").text(adultBx*initBx);
			$("#ADPbxcount").text(adultBx);
			$("#ADTotal").text(adultTotal);
			
			
			//成人价格显示
			$("#ADcount").text(adultWithOutBx);
			$("#unitPrice").text(adultWithOutBxTotal);
			
			//儿童价格显示
			$("#CHDcount").text(child);
			$("#CHDbxFee").text(childBx*initBx);
			$("#CHDbxcount").text(childBx);
			$("#childFare").text(childTotal);
			
			$("#allPriceStr").val(allPriceStr);
			$("#showPrice").text(allPriceStr);
			
		}
		
		
		//选择旅客类型
		function changePassenger(index,type){
			
			var count=$("#hiddenBx"+index).val();
			var passengerType=$("#passengerType"+index).val();
			
			var child=$("#child").val();
			var childBx=$("#childBx").val();
			var adult=$("#adult").val();
			var adultBx=$("#adultBx").val();
			var adultWithOutBx=$("#adultWithOutBx").val();
			
			if(passengerType=='CHD'){
				$('#child').val(parseInt(child)-1);
				if(count==0){
					$('#adultWithOutBx').val(parseInt(adultWithOutBx)+1);
				}else{
					$('#adult').val(parseInt(adult)+1);
					$('#adultBx').val(parseInt(adultBx)+parseInt(count));
					$('#childBx').val(parseInt(childBx)-parseInt(count));
				}
			}else if(passengerType=='NI'){
				$('#child').val(parseInt(child)+1);
				if(count==0){
					$('#adultWithOutBx').val(parseInt(adultWithOutBx)-1);
				}else{
					$('#adult').val(parseInt(adult)-1);
					$('#adultBx').val(parseInt(adultBx)-parseInt(count));
					$('#childBx').val(parseInt(childBx)+parseInt(count));
				}
			}
			$("#passengerType"+index).val(type);
			setPrice();
		}
		
		//选择保险数量
		function changeBx(index,newVal){
			
			var oldVal=$("#hiddenBx"+index).val();
			var passengerType=$("#passengerType"+index).val();
			
			
			var child=$("#child").val();
			var childBx=$("#childBx").val();
			var adult=$("#adult").val();
			var adultBx=$("#adultBx").val();
			var adultWithOutBx=$("#adultWithOutBx").val();
			
			var thisVal=newVal-oldVal;
			
			if(passengerType=='NI'){
				
				if(newVal==0){
					$("#adultWithOutBx").val(parseInt(adultWithOutBx)+1);
					$("#adult").val(parseInt(adult)-1);
					$("#adultBx").val(parseInt(adultBx)-parseInt(oldVal));
				}else{
					if(oldVal==0){
						$("#adultWithOutBx").val(parseInt(adultWithOutBx)-1);
						$("#adult").val(parseInt(adult)+1);
					}
					$("#adultBx").val(parseInt(adultBx)+parseInt(thisVal));
				}
				
			}else if(passengerType=='CHD'){
			/* 	if(newVal==0){
					$("#adultWithOutBx").val(parseInt(adultWithOutBx)+1);
					$("#child").val(parseInt(child)-1);
				} */
				$("#childBx").val(parseInt(childBx)+parseInt(thisVal));
			}
			$("#hiddenBx"+index).val(newVal);
			setPrice();
		}
		
		//添加旅客
		function addPrice(){
			var adult=$("#adult").val();
			var adultBx=$("#adultBx").val();
			/* var initBxDiscount=$("#initBxDiscount").val(); */
			var bxDiscount=$("#bxDiscount").val();
			$("#adult").val(parseInt(adult)+1);
			$("#adultBx").val(parseInt(adultBx)+1);

			$("#adultBx").val(parseInt(adultBx)+1);
			/* $("#bxDiscount").val(parseInt(bxDiscount)+parseInt(initBxDiscount)); */
			
			
			setPrice();
		}
		
		var flightNo="";
		if(${param['flight']}!=null&&'${param['carrier']}'!=null){
			flightNo='${param['carrier']}'+${param['flight']};
		}
		var departureDay='${param['departure_day']}';
 		/* $.ajax({
			type : "post",
			url : __ctxPath+"/front/order/orderSearch.do",
			data :{"cmd":"validateFlight","flightNo":flightNo,"flightDate":departureDay},
			dataType : "json",
			async:false,
			success : function(data) {
				if(data.childNodes!=null){
				var array=data.childNodes[0].childNodes;
				for ( var i = 0; i < array.length; i++) {
					if(array[i].tagName=="Class"){
						var Class=array[i].childNodes;
						Class=Class[0].split(' ');
						if(Class.length>0){
							for ( var j = 0; j < Class.length; j++) {
								var cabin='${param['cabin']}';
								 if(Class[j].indexOf(cabin)!=-1){
									var seat=Class[j].substring(1,2);
								} 
							}
						}
					}
				}}
			},
			error : function() {
				//alert('航班信息获取失败!');
			}
		});  */
	
	</script>
</head>
<body>
	<!--info-->
	<div id="col" mask="订单正在提交，请等待..." style="width: 1000px; margin: 0px auto;">
	<form action="${ctxPath}/front/order/orderSearch.do" method="post" id="doAffirmance">
		<input name="cmd" value="affirmance" type="hidden"/>
		
		
<%
int fuelSurTax= Integer.valueOf(request.getParameter("fuelSurTax"));
int floor= Math.abs(fuelSurTax/2);
int r;  
r = floor%10;  
floor-=r;
request.setAttribute("fuelSurTax",floor);

int yPrice= Integer.valueOf(request.getParameter("yPrice"))/2;
int absPrice= (yPrice%10 <5)?yPrice/10*10:yPrice/10*10+10;
request.setAttribute("yPrice",absPrice);
%>

<input type="hidden" value="${param['policyId']}" name="policy_id">
<input type="hidden" value="${param['carrier']}${param['flight']}" name="flight_no">
<input type="hidden" value="${param['cabin']}" name="cabin">
<input type="hidden" value="${param['departure_day']}" name="departure_day">
<input type="hidden" value="${param['departure_city']}" name="departure_city">
<input type="hidden" value="${boardPointName}" name="departure_airport">
<input type="hidden" value="${param['departure_day']}" name="departure_day">
<input type="hidden" value="${param['duptTime']}" name="departure_time">
<input type="hidden" value="${param['arrival_city']}" name="arrival_city">
<input type="hidden" value="${offPointName}" name="arrival_airport">
<input type="hidden" value="${param['ariTime']}" name="arrival_time">
<input type="hidden" value="${param['flyTime']}" name="flyTime">
<input type="hidden" value="${param['tmp']}" name="tmp">
<input type="hidden" value="1" name="type">
<input type="hidden" value="${param['stop']}" name="stop">
<input type="hidden" value="${param['gx']}" name="gx">
<input type="hidden" value="Y" name="child_cangwei">
<input id="flightType" type="hidden" name="flightType" value="${param['flightType']}">
<input type="hidden" value="<fmt:parseNumber value="${param['price']+param['fuelSurTax']+param['airportTax']}"></fmt:parseNumber>" name="price">
<input type="hidden" value="${param['discount']}" name="discount">
<input type="hidden" value="${param['ticketPrice']}" name="ticketPrice">
<input type="hidden" value="<fmt:parseNumber value="${param['airportTax']}"></fmt:parseNumber>" name="construction_fee">
<input type="hidden" value="<fmt:parseNumber value="${param['fuelSurTax']}"></fmt:parseNumber>" name="fuel_tax">
<input type="hidden" value="<fmt:parseNumber value="${fuelSurTax}"></fmt:parseNumber>" name="child_fuel_tax">
<input type="hidden" value="<fmt:parseNumber value="${yPrice}"></fmt:parseNumber>" name="print_price" id="print_price">


<input type="hidden" value="${param['price']+param['fuelSurTax']+param['airportTax']}" name="salePrice" id="salePrice">
<input type="hidden" value="${param['price']}" name="viewPrice" id="viewPrice">
<%-- <input id="allPriceStr" name="allPriceStr" type="hidden" value="${param['price']+param['fuelSurTax']+param['airportTax']+20-15}"> --%>
<input id="allPriceStr" name="allPriceStr" type="hidden" value="${param['price']+param['fuelSurTax']+param['airportTax']+20}">
<c:choose>
<c:when test="${param['price']+15>param['ticketPrice']}">
<input type="hidden" value="<fmt:parseNumber value="${param['ticketPrice']+param['fuelSurTax']+param['airportTax']}"></fmt:parseNumber>" name="ADPprice" id="ADPprice">
</c:when>
<c:when test="${not empty param['discount'] && param['discount']>0}">
<input type="hidden" value="<fmt:parseNumber value="${param['price']+param['fuelSurTax']+param['airportTax']+15}"></fmt:parseNumber>" name="ADPprice" id="ADPprice">
</c:when>
<c:when test="${empty param['discount'] || param['discount']==0}">
<input type="hidden" value="<fmt:parseNumber value="${param['price']+param['fuelSurTax']+param['airportTax']}"></fmt:parseNumber>" name="ADPprice" id="ADPprice">
</c:when>
</c:choose>
<input type="hidden" value="<fmt:parseNumber value="${param['price']+param['fuelSurTax']+param['airportTax']}"></fmt:parseNumber>"  name="ADprice" id="ADprice">
<input type="hidden" value="<fmt:parseNumber value="${yPrice+fuelSurTax}"></fmt:parseNumber>" name="CHDprice" id="CHDprice">
<input type="hidden" value="<fmt:parseNumber value="${yPrice}"></fmt:parseNumber>" name="CHDViewprice">
<br/>
<input type="hidden" value="0" name="child" id="child"><!-- 儿童人数 -->
<input type="hidden" value="0" name="childBx" id="childBx"><!-- 儿童保险数 -->
<input type="hidden" value="0" name="childTotal" id="childTotal"><!-- 儿童总价 -->
<input type="hidden" value="1" name="adult" id="adult"><!-- 套餐人数 -->
<input type="hidden" value="1" name="adultBx" id="adultBx"><!-- 套餐保险数 -->
<input type="hidden" value="0" name="adultTotal" id="adultTotal"><!-- 套餐总价 -->
<input type="hidden" value="0" name="adultWithOutBx" id="adultWithOutBx"><!-- 成人人数 -->

<input type="hidden" value="${insurancePrice}" name="initBx" id="initBx">
<input type="hidden" value="${benefitCost}" name="bxDiscount" id="bxDiscount">
<input type="hidden" value="${benefitCost}" name="initBxDiscount" id="initBxDiscount">
<input type="hidden" value="${insurancePrice}" name="insuranceStatistics" id="insuranceStatistics">

<input type="hidden" value="0" name="xcdPrice" id="xcdPrice">

<input type="hidden" id="needXcd" value="0" name="needXcd">
<input type="hidden" id="expType" name="expType" value="3">

<input type="hidden" value="0" name="noBx" id="noBx">
		
			<!--right-->
			<div id="ticket_list">
				<ul class="ticket_list_title">
					<table width="100%" border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td><img
								src="${ctxPath}/resource/front/image/international_ticket/booking.gif"
								width="68" height="14" align="absmiddle" />&nbsp;预订信息</td>
							<td align="right"><img
								src="${ctxPath}/resource/front/image/international_ticket/full_in.gif"
								width="179" height="14" />
							</td>
						</tr>
					</table>
				</ul>
				<ul class="ticket_flight">
					<li class="flight_title">&gt;&gt;航班详细信息：</li>
					<li>
						<table width="100%" border="0" cellspacing="0" cellpadding="0">
							<tr class="flight_font">
								<td class="flight_table_toplast" colspan="9">已选择的航班：</td>
							</tr>
							<tr align="center" class="flight_font">
								<td class="flight_table_top">航程类型</td>
								<td class="flight_table_top">航空公司</td>
								<td class="flight_table_top">航班号</td>
								<td class="flight_table_top">舱位</td>
								<td class="flight_table_top">航班时间</td>
								<td class="flight_table_top">起降机场</td>
								<td class="flight_table_top">里程</td>
								<td class="flight_table_top">飞行时间</td>
								<td class="flight_table_toplast">经停</td>
							</tr>
							<tr align="center">
								<td class="flight_table_top">单程</td>
								<td class="flight_table_top"><img
									src="${ctxPath}/resource/front/js/airlineImage/${param['carrier']}.gif"
									align="absmiddle" />&nbsp;&nbsp; <label id="flightName"></label> 
								<input name="carrierName" id="carrierName" type="hidden"/>	
								</td>
								<td class="flight_table_top"><font color="#000000"><strong>${param['carrier']}${param['flight']}</strong>
								</font>
								</td>
								<td class="flight_table_top">
									<p>成人：${param['cabin']}舱</p>
									<p>儿童：Y舱</p></td>
								<td class="flight_table_top">
									<p>${param['departure_day']}</p>
									<p>
										<font color="#000000"><strong>${param['duptTime']}-${param['ariTime']}</strong>
										</font>
									</p></td>
								<td class="flight_table_top">
									<p>起：${boardPointName}</p>
									<p>降：${offPointName}</p></td>
								<td class="flight_table_top">${param['tmp']}公里</td>
								<td class="flight_table_top">${param['flyTime']}</td>
								<td class="flight_table_toplast">0</td>
							</tr>
							<tr class="flight_font">
								<td class="flight_tablelast" colspan="9">*如查询信息（包含：航班、航段、日期）或航班飞行线路没有合适的选择，可以致电客服：4007-168-138
									咨询其他航班信息。</td>
							</tr>
						</table></li>
				</ul>
				<ul class="ticket_flight">
					<li class="flight_title">&gt;&gt;价格信息如下：</li>
					<li>
						<table width="100%" border="0" cellspacing="0" cellpadding="0">
							<tr align="center" class="flight_font">
								<td class="flight_table_top">旅客类型</td>
								<td class="flight_table_top">价格</td>
								<td class="flight_table_top">机建/燃油</td>
								<td class="flight_table_top">人数</td>
								<td class="flight_table_top">保险</td>
								<td class="flight_table_top">保险份数</td>
								<td class="flight_table_top">合计</td>
								<td class="flight_table_top">快递</td>
								<td class="flight_table_toplast">订单总价</td>
							</tr>
							<tr align="center">
								<td class="flight_table_top"><img  id="adpImage" src="${ctxPath}/resource/front/image/international_ticket/Boolean_072.png" align="absmiddle"/>成人(套餐)</td>
								<td class="flight_table_top"><font color="#000000"><strong>¥${param['price']}</strong>
								</font>
								</td>
								<td class="flight_table_top">¥${param['airportTax']} / ¥${param['fuelSurTax']} </td>
								<td class="flight_table_top"><span id="ADPcount">1</span></td>
								<td class="flight_table_top">¥<label id="ADPbxFee">${insurancePrice}</label></td>
								<td class="flight_table_top"><label id="ADPbxcount">1</label></td>
								<td class="flight_table_top"><strong id="ADTotal">¥${param['price']+param['fuelSurTax']+param['airportTax']+20}</strong>
								</td>
								<td class="flight_table_top" rowspan="3"><label id="showXcd">¥0</label></td>
								<td class="flight_table_toplast" rowspan="3"><font
									color="#FF3300" size="+1">¥<strong id="showPrice">${param['price']+param['fuelSurTax']+param['airportTax']+20}</strong>
								</font></td>
							</tr>
								<tr align="center">
								<td class="flight_table_top"><img id="adImage" style="display: none;" src="${ctxPath}/resource/front/image/international_ticket/Boolean_072.png" align="absmiddle"/>成人</td>
								<td class="flight_table_top"><font color="#000000">
								<c:choose>
								<c:when test="${param['ticketPrice'] < param['price']+15}">
								<strong>¥${param['ticketPrice']}</strong>
								</c:when>
								<c:when test="${not empty param['discount'] && param['discount']>0}">
								<strong>¥${param['price']+15}</strong>
								</c:when>
								<c:when test="${empty param['discount'] || param['discount']==0}">
								<strong>¥${param['price']}</strong>
								</c:when>
								</c:choose>
								</font>
								</td>
								<td class="flight_table_top">¥${param['airportTax']} / ¥${param['fuelSurTax']} </td>
								<td class="flight_table_top"><label id="ADcount">0</label></td>
								<td class="flight_table_top">¥<label id="ADbxFee">0</label></td>
								<td class="flight_table_top"><label id="ADbxcount">0</label></td>
								<td class="flight_table_top"><strong id="unitPrice">0</strong>
								</td>
							</tr>
							</tr>
							<tr align="center">
								<td class="flight_table_top"><img id="chdImage" style="display: none;" src="${ctxPath}/resource/front/image/international_ticket/Boolean_072.png" align="absmiddle"/>儿童</td>
								<td class="flight_table_top"><font color="#000000"><strong>¥${yPrice}</strong>
								</font>
								</td>
								<td class="flight_table_top">¥0 / ¥ ${fuelSurTax}</td>
								<td class="flight_table_top"><label id="CHDcount">0</label></td>
								<td class="flight_table_top">¥<label id="CHDbxFee">0</label></td>
								<td class="flight_table_top"><label id="CHDbxcount">0</label></td>
								<td class="flight_table_top"><strong id="childFare">0</strong></td>
							</tr>
							<tr class="flight_font">
								<td class="flight_tableleftlast" align="center">退票/更改/签转规定：</td>
								<td class="flight_tablelast" colspan="9">
								<!-- 	<p>
										<strong>成人：</strong>
									</p>
									<p>更改条件 —— 需每次收取票面价20%的改签费</p>
									<p>退票条件 —— 需收取票面价50%的退票费</p>
									<p>签转条件 —— 不允许签转</p>
									<p>&nbsp;</p>
									<p>
										<strong>儿童：</strong>
									</p>
									<p>退改签规则以航空公司最新规定为准，可咨询客服电话（4007-168-138）</p></td> -->
								<c:if test="${not empty policy.backNote}">${policy.backNote}</c:if>
								<c:if test="${empty policy.backNote}"><p>按照航空公司退改签规定执行。或致电美瀛客服4007168138，获得相关说明</p></c:if>
							</tr>
						</table></li>
				</ul>
				<ul>
					<table width="100%" border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td class="ticket_book_title"><font color="#3367B6"><strong>&gt;&gt;基本信息填写</strong>
							</font>
							</td>
							<td class="ticket_book_title" align="right"><input name=""
								type="checkbox" value="" checked="checked" />我已阅读并同意<a
								href="ticket_proviso.htm">《网络电子客票协议》</a>及<a
								href="tickets_Insurance_proviso.htm">《保险说明》</a></td>
						</tr>
					</table>
				</ul>
				<ul class="book_individual">
					<li>
						<table width="100%" border="0" cellspacing="0" cellpadding="0">
							<tr>
								<td width="20%" class="book_title"><img
									src="${ctxPath}/resource/front/image/public/news_dot.gif" width="5" height="12"
									align="absmiddle" />&nbsp;乘机人信息</td>
								<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;带<font
									color="#FF0000">*</font>号部分为必填写项</td>
							</tr>
						</table></li>

					<!--增加乘机人-->
					<div id="add" class="add">
						<div class="fatie" id="fatie">
							<div class="options">
						<dd>
							<input type="hidden" value="1" id="hiddenBx0"/>
							<input type="hidden" value="NI" id="passengerType0"/>
							<label><span class="cro">*</span> 乘客类型：<select name="passengerType" class="age" onchange="changePassenger(0,this.value)"><option value="NI">成人(&gt;12岁)</option><option value="CHD">儿童(2~12岁)</option></select></label><label class="name"><span class="cro">*</span>乘客姓名：<input name="passengName" type="text" id="passengName0" onblur="checkName(this,0)"  check=3 tip="不能为空"/></label></label><span class="cro">*</span>证件号码：<select name="card" onchange="showSex(this,0)" id="card0"><option value="NI">身份证</option><option value="PP">护照</option><option value="ID">其他</option></select><input type="text" class="int" onblur="isCard(this.value,this,0)" name="cardNo" id="cardNo0" check='3' tip="不能为空"/><label class="safe">保险：<select name="bx" onchange="changeBx('0',this.value)">
							<% for(int i=0;i<=10;i++){%><option <% if(i==1){%>selected="selected" <%} %> value="<%= i %>"><%= i %>份</option>
							<% } %>
							</select> ￥20/份<br/>
							</label><div class="no" id="num0" style="display: none;"><label class="num"  ><span class="cro">*</span>性别：<select name="sex"><option value="1">男</option><option value="0">女</option></select></label><label><span class="cro">*</span>出生日期：<input type="text" name="passengerBirthday" id="passengerBirthday0" onblur="regCheckDate(this.value,this)" check='' tip="不能为空,输入格式yyyy-MM-dd，如2012-02-03"/></label></div></dd>
							</div>
						</div>
						<!--添加人按钮-->
						<p class="add_opt">
							<span id="base_icon">+添加一位乘机人</span> <!-- <span id="inn"
								style="display: none; color: #F36">同一订单仅支持9位乘客</span> --><span id="inn"
								style="display: none; color: #F36">本次航班最多可预定${param['bookSeat']}位乘客</span>
						</p>
					</div>
					
					<li class="book_type">
					  可选保险信息：
					  	<c:forEach items="${insurances}" var="insurance" varStatus="item">
					     <p><input type="radio" <c:if test="${item.count==1}">checked="checked"</c:if> name="insuranceCompanyId" id="insuranceCompanyId" value="${insurance.id}">
					     ${insurance.type}: (${insurance.description})</p>
				    	</c:forEach>
				    </li>
				</ul>
				<ul class="book_linkman">
					<li>
						<table width="100%" border="0" cellspacing="0" cellpadding="0">
							<tr>
								<td width="20%" class="book_linemantitle"><img
									src="${ctxPath}/resource/front/image/public/news_dot.gif" width="5" height="12"
									align="absmiddle" />&nbsp;联系人信息</td>
								<td colspan="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;带<font
									color="#FF0000">*</font>号部分为必填写项</td>
							</tr>
						</table></li>
					<li class="book_type"><span class="cro">*</span> 联系姓名： <input
						type="text" name="contact" id="contact" check="2" tip="不能为空" class="selectbox" /> <span
						class="cro">*</span> 手机号码： <input type="text" check="2" tip="不能为空" errorTip="请填写正确的手机号码" id="contactMob" name="contactMob"
						class="selectbox" /> &nbsp;&nbsp;电子邮箱：&nbsp;<input type="text"
						name="contactEmail" id="contactEmail" class="contactEmail" errorTip="请输入正确的邮箱格式"/>
					</li>
				</ul>
				<!-- <ul class="book_linkman">
					<li>
						<table width="100%" border="0" cellspacing="0" cellpadding="0">
							<tr>
								<td width="20%" class="book_linemantitle"><img
									src="${ctxPath}/resource/front/image/public/news_dot.gif" width="5" height="12"
									align="absmiddle" />&nbsp;支付方式</td>
								<td colspan="2">&nbsp;</td>
							</tr>
						</table></li>
				<li class="book_linemanlist">&nbsp;&nbsp;支付方式： <input
						type="radio" name="payStatus" value="radiobutton" /> <font
						color="#FF0000">在线支付</font> <input type="radio" name="radiobutton" value="radiobutton" /> 门市支付
	  <input type="radio" name="radiobutton" value="radiobutton" /> 银行汇款 (汇款后请拨打 客服热线：4007-168-138 确认)
					</li> 

				</ul> -->
				<ul class="book_message">
					<li>
						<table width="100%" border="0" cellspacing="0" cellpadding="0">
							<tr>
								<td width="20%" class="book_linemantitle"><img
									src="${ctxPath}/resource/front/image/public/news_dot.gif" width="5" height="12"
									align="absmiddle" />&nbsp;客户留言和报销凭证</td>
								<td colspan="2">&nbsp;</td>
							</tr>
						</table></li>
					<li class="book_type">&nbsp;&nbsp;客户留言： <textarea
							name="xcd" class="bookbox500"></textarea></li>
					<li class="book_type"><input name="needXC" id="needXC" type="checkbox" value="1"
						onclick="show_take_table()" />行程单<font
						color="#0066FF"> (行程单只作为报销凭证，不能作为乘机凭证。乘机只需要订票时的证件)</font>&nbsp;&nbsp;&nbsp;&nbsp;
						<input name="needFP" id="needFP" type="checkbox" value="1"
						onclick="show_take_table()" />保险发票<font
						color="#0066FF"> (此发票仅作为美瀛商旅网平台购买保险的报销凭证) </font></li>

					<div id="take_table" style="display: none">
						<p style="margin-left: 23px">
							递送方式：<%-- <input name="express" onclick="changeExpress(this,1)" type="radio" value="0" checked />平邮<span
								style="color: #999; margin-left: 40px">快递费0元。航班起飞后一周内寄出，起飞后超过7天不可打印行程单。</span><br/> 
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
								<input name="express" onclick="changeExpress(this,2)" type="radio" value="${surface}" />挂号<span style="color: #999; margin-left: 40px">快递费${surface}元。航班起飞后一周内寄出，起飞后超过7天不可打印行程单。</span><br/>
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
								<input name="express" onclick="changeExpress(this,3)" type="radio" value="${xcdPrice}"  />快递<span style="color: #999; margin-left: 40px">快递费${xcdPrice}元。航班起飞后一周内寄出，起飞后超过7天不可打印行程单。</span> --%>
								<input name="express" onclick="changeExpress(this,3)" type="radio" value="${xcdPrice}" checked/>快递<span style="color: #999; margin-left: 40px">快递费${xcdPrice}元。航班起飞后7天内寄出,1-2个工作日送达。 </span><br/> 
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
								<input name="express" onclick="changeExpress(this,2)" type="radio" value="${surface}" />挂号<span style="color: #999; margin-left: 40px">快递费${surface}元。航班起飞后7天内寄出,7-14个工作日送达。</span><br/>
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
								<input name="express" onclick="changeExpress(this,1)" type="radio" value="0"  />平邮<span
								style="color: #999; margin-left: 40px">快递费0元。航班起飞后7天内寄出,14-28个工作日送达。</span>
						</p>
						<table width="900" border="0" cellspacing="0" cellpadding="0"
							style="margin-top: 15px">
							<tr>
								<td><span style="color: #f00; margin: 10px">*</span>收件人：</td>
								<td><input type="text" class="take_s" name="sjr" id="sjr" check="" tip="不能为空"/> <span
									style="color: #999; margin-left: 20px">同为联系人</span>
								</td>
								<td><span style="color: #f00; margin: 10px">*</span>联系电话：</td>
								<td><input type="text" class="take_s" name="contactTel" id="contactTel" check="" tip="不能为空" errorTip="请填写正确的手机号码"/>
								</td>
								<td><span style="color: #f00; margin: 10px">*</span>邮政编码：</td>
								<td><input type="text" class="take_s" name="contactCode" id="contactCode" check="" tip="不能为空" errorTip="请填写正确的邮编"/>
								</td>
							</tr> 
							<tr>
								<td>&nbsp;</td>
								<td>&nbsp;</td>
								<td>&nbsp;</td>
								<td>&nbsp;</td>
								<td>&nbsp;</td>
								<td>&nbsp;</td>
							</tr>
							<tr>
								<td colspan="6"><span style="color: #f00; margin: 10px">*</span>送票地址：
									<input type="text" class="take_b" name="address"  id="address" check="" tip="不能为空"/> <span
									style="color: #999; margin-left: 30px">填写方式：省/市区/县/区/路</span>
								</td>
							</tr>
						</table>

					</div>
				</ul>
			</div>
			<ul class="book_type">
				<table width="100%" border="0" cellspacing="0" cellpadding="0">
					<tr>
						<td align="right" class="inputsubmit_line"><input name="Submit2"
								type="submit" class="inputsubmit" value="上一步" />
						</td>
						<td align="left" class="inputsubmit_line"><input name="Submit2"
								type="submit" class="inputsubmit" value="提交订单" />
						</td>
					</tr>
				</table>
			</ul>
		</form>
		</div>

	<!--判断9位乘客-->
	<script type="text/javascript">

	var bookSeat='${param['bookSeat']}'-2;
		var q = 0;
		var o = document.getElementById('inn');
		var b = document.getElementById('base_icon');
		function queryclick(index) {
			if (document.getElementById("base_icon1").value = "true");
			q = q - 1;
			if (q < bookSeat)
				b.style.display = "block";
			o.style.display = "none";
			q = 0;
			
			var bxCount=$("#hiddenBx"+index).val();
			var type=$("#passengerType"+index).val();
			
			var child=$("#child").val();
			var childBx=$("#childBx").val();
			var adult=$("#adult").val();
			var adultBx=$("#adultBx").val();
			var adultWithOutBx=$("#adultWithOutBx").val();
			
			if(type=='CHD'){
				$('#child').val(parseInt(child)-1);
				if(bxCount>0){
					$('#childBx').val(parseInt(childBx)-parseInt(bxCount));
				}
				
			}if(type=='NI'){
				if(bxCount==0){
					$('#adultWithOutBx').val(parseInt(adultWithOutBx)-1);
				}else{
				$('#adult').val(parseInt(adult)-1);
				$('#adultBx').val(parseInt(adultBx)-parseInt(bxCount));
				}
			}
			
		/* 	if(bxCount>0){
				var initBxDiscount=$("#initBxDiscount").val();
				var bxDiscount=$("#bxDiscount").val();
				$("#bxDiscount").val(parseInt(bxDiscount)+parseInt(initBxDiscount));
			} */
			
			$("#passengName"+index).attr("check","");
			$("#cardNo"+index).attr("check","");
			$("#passengerBirthday"+index).attr("check","");
			setPrice();
		}
		function on_click() {
			var bookSeat='${param['bookSeat']}'-2;
			if (document.getElementById("base_icon1").value == "true")
				;
			q = q + 1;
			if (q >= bookSeat)
				b.style.display = "none";
		}

		$(document)
				.ready(
						function() {//增加人数控制
							var fatie = $("#fatie");
							var option = fatie.find(".options dd");
							function list_again() {//选项重新排序
								option.each(function() {
									var i = $(this).index();
								})
							}

							option.find("a").live("click", function() {//删除选项
								$(this).parent().remove();
								list_again();
							})
							
							var bookSeat='${param['bookSeat']}'-1;
							$('#base_icon')
									.live(
											'click',
											function() {
												if ($('.options dd').length > bookSeat) {
													$('#inn').css('display',
															'block');
													return false;
												}
														var str='<dd>';
												/* 		.append('<label><span class="cro">*</span>乘客类型：<select name="passengerType" class="age"><option value="1">成人(&gt;12岁)</option><option value="0">儿童(2~12岁)</option></select></label>')
														.append('<label class="name"><span class="cro">*</span>乘客姓名：<input name="passengName" type="text" /></label>')
														.append('<label class="num"><span class="cro">*</span>性别：<select name="sex"><option value="1">男</option><option value="0">女</option></select><span class="cro">*</span>出生日期：<input name="passengerBirthday" type="text" /></label>')
														.append('<label class="safe">保险：<select name="bx" ><option>0份</option><option selected="selected" value="1">1份</option><option value="2">2份</option></select>￥20/份<br /></label>')
														.append('<div class="no"><span class="cro">*</span>证件号码：<select name="card" ><option  value="1">身份证</option><option  value="2">护照</option><option  value="3">其他</option></select><input name="cardNo" type="text" class="int" /></div>')
														.append('<a title="删除" id="base_icon1"href="javascript:void(0);" onclick="queryclick()">删除</a>');
												 */	
												 var checkId=parseInt(option.length)+1;
												 str+='<input type="hidden" value="1" id="hiddenBx'+checkId+'"/>';
												 str+='<input type="hidden" value="NI" id="passengerType'+checkId+'"/>';
												 str+='<label><span class="cro">*</span>乘客类型：<select name="passengerType" class="age" onchange="changePassenger('+checkId+',this.value)" ><option value="NI">成人(&gt;12岁)</option><option value="CHD">儿童(2~12岁)</option></select></label>';
												 str+='<label class="name"><span class="cro">*</span>乘客姓名：<input name="passengName" id="passengName'+checkId+'" onblur="checkName(this,0)" check="3" tip="不能为空 " type="text" /></label>';
												 str+='<span class="cro">*</span>证件号码：<label class="num"><select name="card" id="card'+checkId+'" onchange="showSex(this,'+checkId+')"><option  value="NI">身份证</option><option  value="PP">护照</option><option  value="ID">其他</option></select></label><label><input name="cardNo" onblur="isCard(this.value,this,'+checkId+')" check="3" tip="不能为空"  id="cardNo'+checkId+'" type="text" class="int" /></label>';
												 str+='<label class="safe">保险：<select name="bx" onchange="changeBx('+checkId+',this.value)">';
												 str+='<% for(int i=0;i<=10;i++){%><option <% if(i==1){%>selected="selected" <%} %> value="<%= i %>"><%= i %>份</option><% } %></select>￥20/份<br /></label>';
												 str+='<div class="no" id="num'+checkId+'" style="display:none;"><span class="cro">*</span>性别：<select name="sex"><option value="1">男</option><option value="0">女</option></select><span class="cro">*</span>出生日期：<input name="passengerBirthday" onblur="regCheckDate(this.value,this)" type="text" id="passengerBirthday'+checkId+'" check="" tip="不能为空,输入格式yyyy-MM-dd，如2012-02-03"/></div>';
												 str+='<a title="删除" id="base_icon1"href="javascript:void(0);" onclick="queryclick('+checkId+')">删除</a>';
												 str+='</dd>';
												fatie.find(".options").append(str);
												 option = fatie.find(".options dd");
											 	// setEmptyCheck("passengName"+option.length);	
											/*	 setEmptyCheck("cardNo"+option.length);  */
												// setIDCheck("cardNo"+option.length);	
											/* 	$("#passengName"+checkId).tooltip();
												$("#cardNo"+checkId).tooltip();
												$("#passengerBirthday"+checkId).tooltip(); */
												$('input[tip]').tooltip();
												list_again();
												addPrice();
											});

							$('.option a[title="删除"]').live('click',
									function() {
										$('#inn').css('display', 'none');
									});

						});
	</script>
</body>

</html>
